
<?php
class Catalog_Form_CategoryForm extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');

        $category = new Catalog_Model_Category();

        $definition = $category->getTable()->getColumnDefinition('title');
        $this->addElement('text', 'title', array(
            'label'      => 'Title',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('validator' => 'StringLength',
                      'options' => array(0, $definition['length']))
            )
        ));


        $this->addElement('checkbox', 'active', array(
            'label'      => 'Active',
        ));



        $this->addElement('submit', 'submit', array(
            'label'    => 'save',
        ));
    }
}
